import request from '@/utils/request'

export function selectPage(data) {
    return request({
        url: '/specOption/findPage',
        method: 'post',
        data
    })
}

export function save(data) {
    return request({
        url: '/specOption/save',
        method: 'post',
        data
    })
}

// 查询所有的规格信息
export function findAllSpec() {
    return request({
        url: '/specOption/findAllSpec',
        method: 'get'
    })
}

//查一个规格选项信息
export function findOne(optId) {
    return request({
        url: `/specOption/findOne/${optId}`,
        method: 'get',
    })
}

// 修改选项信息
export function updateOption(data) {
    return request({
        url: '/specOption/updateOption',
        method: 'post',
        data
    })
}

//删除指定 的规格选项
export function delByOptId(optId) {
    return request({
        url: `/specOption/delByOptId/${optId}`,
        method: 'delete'
    })
}